package com.eu.chipin;

import java.util.List;

import com.eu.chipin.backend.ContactPicker;
import com.eu.chipin.backend.Member;
import com.eu.chipin.backend.Trip;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ViewTripActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_trip);
        
        final Trip trip = (Trip) this.getIntent().getExtras().get("trip");
        TextView title = (TextView)findViewById(R.id.textView1);
        title.setText(trip.getName());
        
        Button addPurchase = (Button) findViewById(R.id.button1);
        addPurchase.setOnClickListener(new OnClickListener() {

          public void onClick(View v) {
            Intent intent = new Intent(ViewTripActivity.this, NewPurchaseActivity.class);
            intent.putExtra("trip", trip);
            startActivity(intent);
          }
        });
        
        Button expenses = (Button) findViewById(R.id.button2);
        expenses.setOnClickListener(new OnClickListener() {

          public void onClick(View v) {
            Intent intent = new Intent(ViewTripActivity.this, CurrentExpensesActivity.class);
            intent.putExtra("trip", trip);
            startActivity(intent);
          }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_view_trip, menu);
        return true;
    }
}
